Questions tagged [global]
Refers to a space where variables and other items may be accessed from any scope.
global
4,725
questions
1283
votes
14
answers
580k
views
Global Git ignore
I want to set up Git to globally ignore certain files.
I have added a .gitignore file to my home directory (/Users/me/) and I have added the following line to it:
*.tmproj
But it is not ignoring ...
491
votes
11
answers
182k
views
What does "nonlocal" do in Python 3?
What does nonlocal do in Python 3.x?
To close debugging questions where OP needs nonlocal and doesn't realize it, please use Is it possible to modify variable in python that is in outer, but not ...
339
votes
10
answers
477k
views
Using global variables between files?
I'm bit confused about how the global variables work. I have a large project, with around 50 files, and I need to define global variables for all those files.
What I did was define them in my ...
240
votes
13
answers
167k
views
Ruby on Rails: Where to define global constants?
I'm just getting started with my first Ruby on Rails webapp. I've got a bunch of different models, views, controllers, and so on.
I'm wanting to find a good place to stick definitions of truly ...
227
votes
3
answers
104k
views
Augmentations for the global scope can only be directly nested in external modules or ambient module declarations(2669)
I would like to store my NodeJS config in the global scope.
I tried to follow this => Extending TypeScript Global object in node.js and other solution on stackoverflow,
I made a file called global....
205
votes
10
answers
521k
views
How to declare a global variable in php?
I have code something like this:
<?
$a="localhost";
function body(){
global $a;
echo $a;
}
function head(){
global $a;
echo $a;
}
function ...
193
votes
3
answers
134k
views
What happens to global and static variables in a shared library when it is dynamically linked?
I'm trying to understand what happens when modules with globals and static variables are dynamically linked to an application.
By modules, I mean each project in a solution (I work a lot with visual ...
192
votes
5
answers
146k
views
Can I make a function available in every controller in angular?
If I have a utility function foo that I want to be able to call from anywhere inside of my ng-app declaration. Is there someway I can make it globally accessible in my module setup or do I need to add ...
161
votes
2
answers
112k
views
Global variables in Javascript and ESLint
I have got multiple javascript files and I have defined some global variable in a file which loads before the others.
As a consequence all of the files loaded after the first have access to the global ...
156
votes
9
answers
301k
views
Global variables in Javascript across multiple files
A bunch of my JavaScript code is in an external file called helpers.js. Inside the HTML that calls this JavaScript code I find myself in need of knowing if a certain function from helpers.js has been ...
130
votes
12
answers
193k
views
How to make a cross-module variable?
The __debug__ variable is handy in part because it affects every module. If I want to create another variable that works the same way, how would I do it?
The variable (let's be original and call it '...
127
votes
2
answers
95k
views
Find and replace globally in Sublime Text 2 (all files and in all directories)
Is there a way to find and replace a text string automatically in all folder's files?
111
votes
11
answers
91k
views
Where to store global constants in an iOS application?
Most of the models in my iOS app query a web server. I would like to have a configuration file storing the base URL of the server. It will look something like this:
// production
// static NSString* ...
110
votes
7
answers
97k
views
What is the 'global' object in NodeJS
I've just seen a weird behaviour of the this keyword in NodeJS environment. I'm listing them with code. I've run this code with NodeJS v6.x, with a single JavaScript file.
While testing with one line ...
107
votes
10
answers
112k
views
Extending TypeScript Global object in node.js
I have a node.js app that attaches some config information to the global object:
global.myConfig = {
a: 1,
b: 2
}
The TypeScript compiler doesn't like this because the Global type has no ...