This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 3 ways to loop through each character in a string | |
$text = "hello world"; | |
for $i (0..length($text)-1){ | |
$char = substr($text, $i, 1); | |
print "Index: $i, Text: $char \n"; | |
} | |
foreach $char (split //, $text) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
class MainClass { | |
public static void Main (string[] args) { | |
Dictionary<string, List<String>> map = new Dictionary<string, List<String>>(); | |
// create list one and store values | |
List<string> valSetOne = new List<string>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For iMessage/Facetime to activate after SIM change, iOS update or iMessage off/on, | |
iOS would be trying to send a background international TXT to the UK +44 (is 31c/SMS on prepay). | |
This is for Apple to validate the mobile number as yours so that people can't spoof your mobile number | |
and pretend to be you through iMessage/Facetime. | |
iMessages themselves are of course, not charged at all by Vodafone per message, | |
iMessages only use a relatively small ammount of internet data be that mobile or WiFi at home or whatever. | |
Taken from: https://community.vodafone.co.nz/t5/iPhone-iPad/HELP-text-message-and-Imessage-issues/td-p/124287 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git add . | |
# see what changes are going to be commited | |
git status | |
git commit -m 'Some descriptive commit message' | |
git push origin master | |
# go to the gh-pages branch | |
git checkout gh-pages | |
# bring gh-pages up to date with master | |
git rebase master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var o = new ActiveXObject("WScript.Shell"); | |
//Force x86 Version | |
o.Run("C:\\Windows\\SysWOW64\\WindowsPowerShell\\v1.0\\powershell.exe -windowstyle hidden"); | |
WScript.Sleep(5000); | |
o.AppActivate("powershell"); | |
o.SendKeys("Get-Process > output.txt {Enter}"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# echo '{"_payload":{"navigationResult":{"list":[{"order_id":"2","date":"date"}]}}}' | python parser.py | |
# python parser.py --input input.json | |
# see: http://stackoverflow.com/questions/2264991/how-to-read-from-stdin-or-from-a-file-if-no-data-is-piped-in-python | |
import argparse | |
import json | |
def parse(json_data): | |
data = json.load(json_data) | |
resultlist = data['_payload']['navigationResult']['list'] |