Skip to content

Instantly share code, notes, and snippets.

View mytholog's full-sized avatar

Igor Gavrilov mytholog

  • 2Gis
  • Russia
View GitHub Profile
[[constraint]]
name="k8s.io/apimachinery"
revision="1fd2e63a9a370677308a42f24fd40c86438afddf"
[[constraint]]
name="k8s.io/client-go"
branch="release-4.0"
@myshov
myshov / function_invocation.js
Last active January 21, 2024 15:14
11 Ways to Invoke a Function
console.log(1);
(_ => console.log(2))();
eval('console.log(3);');
console.log.call(null, 4);
console.log.apply(null, [5]);
new Function('console.log(6)')();
Reflect.apply(console.log, null, [7])
Reflect.construct(function(){console.log(8)}, []);
Function.prototype.apply.call(console.log, null, [9]);
Function.prototype.call.call(console.log, null, 10);
@btroncone
btroncone / rxjs_operators_by_example.md
Last active July 16, 2023 14:57
RxJS 5 Operators By Example
@boopathi
boopathi / README.md
Last active August 28, 2023 14:35
Creating a Swift-ReactNative project

Settings

  1. Create a project in XCode with the default settings
    • iOS > Application > Single View Application
    • Language: Swift
  2. Under project General settings, add ReactKit to Linked Framework and Libraries
    • + > Add Other... and choose /path/to/react-native/ReactKit/ReactKit.xcodeproj
  3. Now ReactKit would have been imported. Link it by choosing it from the list.
    • + > lib.ReactKit.a
  4. Under project Build Settings,
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active April 20, 2024 16:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@neilsoult
neilsoult / LazyLoad.js
Created October 31, 2013 19:40
LazyLoad directive for loading external javascript for AngularJs. In this example, I use google maps' API as the external library being loaded
angular.module('testApp', []).
directive('lazyLoad', ['$window', '$q', function ($window, $q) {
function load_script() {
var s = document.createElement('script'); // use global document since Angular's $document is weak
s.src = 'https://maps.googleapis.com/maps/api/js?sensor=false&callback=initialize';
document.body.appendChild(s);
}
function lazyLoadApi(key) {
var deferred = $q.defer();
$window.initialize = function () {
@mytholog
mytholog / gist:4490916
Last active December 10, 2015 20:49
isAssoc
public static function isAssoc(array $arr)
{
return array_keys($arr) !== range(0, count($arr) - 1);
}
@compwright
compwright / Process_Manager.php
Created December 5, 2012 04:10
Demo code used in my "Multitasking in PHP" presentation at the December 2012 Atlanta PHP user group meetup
<?php
class Process_Manager implements Countable
{
protected $processes = array();
protected $is_child = FALSE;
public function count()
{
return count($this->processes);
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
@ianbarber
ianbarber / multiprocess.php
Created December 5, 2010 12:59
Distribute work across subprocesses using 0MQ
<?php
$num_workers = 5;
$pid = 1;
for($i = 0; $i < $num_workers; $i++) {
$pid = pcntl_fork();
if($pid == 0) {
break;
}
}