Skip to content

Instantly share code, notes, and snippets.

View web20opensource's full-sized avatar
🎯
Focusing

Mario Ruiz web20opensource

🎯
Focusing
View GitHub Profile
@getify
getify / 1.js
Last active August 4, 2023 06:24
Converting English number sentences ("one hundred forty two point three") to numeric digits ("142.3")
convert("one hundred five"); // "105"
convert("six hundred and fifty three"); // "653"
convert("zero zero one two three"); // "123"
convert("twelve o three"); // "1203"
convert("thirteen zero nine"); // "1309"
convert("fifteen sixteen"); // "1516"
convert("fourteen ninety two"); // "1492"
convert("nineteen ten"); // "1910"
convert("twelve hundred"); // "1200"
convert("twenty three hundred"); // "2300"
@warecrash
warecrash / makekali.sh
Last active June 24, 2024 16:13
Convert Debian to Kali
apt update
apt -y install wget gnupg dirmngr
wget -q -O - https://archive.kali.org/archive-key.asc | gpg --import
gpg --keyserver hkp://keys.gnupg.net --recv-key 44C6513A8E4FB3D30875F758ED444FF07D8D0BF6
echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" >> /etc/apt/sources.list
gpg -a --export ED444FF07D8D0BF6 | sudo apt-key add -
apt update
apt -y upgrade
apt -y dist-upgrade
apt -y autoremove --purge
@mike-north
mike-north / setup.md
Last active October 8, 2015 15:08
frontendmasters.com - Ember 2.0 workshop - project setup

Front End Masters Ember.js Workshop - Setup

Windows + OS X

Make sure you have node.js installed.

You can verify that you have node.js by running node -v and you should see something like v0.12.7

Install ember-cli

@staltz
staltz / gist:78140b885f366886d9b5
Last active August 29, 2015 14:19
Terse Cycle.js

Terse Cycle.js

Take Cycle's primal example, on the README:

import Cycle from 'cyclejs';
let {Rx, h} = Cycle;

let name$ = Cycle.createStream(function model(changeName$) {
@web20opensource
web20opensource / ex12
Last active August 29, 2015 14:19
Learning RxJs
return movieLists.map(
// map receives 3 args
// cat - element to iterate
// cIndex - index in the array of the element
// cCollection - movieLists array
// same applies for the rest if the code
(cat, cIndex, cCollection) => {
//v for videos object
return cat.videos.map ( (v,vIndex,vCollection) => {
@victordf
victordf / desafio.php
Created April 10, 2015 21:01
Desafio Folha
$g = array(
'halley' => 'amarelo',
'encke' => 'vermelho',
'wolf' => 'preto',
'kushida' => 'azul'
);
$l = array(
'a' => 1,
'z' => 26
var fib = [1,2] , i=0;j=1 , index=2 , sum=2;
while ( fib[j]<4*Math.pow(10,6) ){
fib[index] = fib[i]+fib[j];
if (4*Math.pow(10,6)<=fib[index]) {
break;
}
if ( !(fib[index]%2) )
sum+=fib[index];
#include <dlfcn.h>
void OverrideForRecording() {
NSInteger (*SBSSpringBoardServerPort)() = dlsym(RTLD_NEXT, "SBSSpringBoardServerPort");
NSInteger (*SBSetShowsOverridesForRecording)(NSInteger, NSInteger) = dlsym(RTLD_NEXT, "SBSetShowsOverridesForRecording");
SBSetShowsOverridesForRecording(SBSSpringBoardServerPort(), 1);
}
@web20opensource
web20opensource / _map.js
Last active August 29, 2015 14:18
mapping with map js javascript
console.time('mapping in js');
var isAType = {};
isAType._array = "[object Array]";
isAType._function = "[object Function]";
isAType._string = "[object String]";
isAType.isFunction = function(fn) {
return Object.prototype.toString.call(fn) === this._function;
}
@web20opensource
web20opensource / palindrome
Last active August 29, 2015 14:17
Check if a given text is a palindrome
var isPalindrome = function(text){
while(text.length!=1){
var firstChar = text.charAt(0);
var lastChar = text.charAt(text.length-1);
if (firstChar===lastChar){
text = text.substr(1,text.length-2);
}
else{
return false;
}