This file contains hidden or 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
<?php | |
$fullname = 'test1'; | |
$username = 'test1'; | |
$email = '[email protected]'; | |
$password = '123456'; | |
$xmlRpc = new XmlRPC('http://localhost:8090','/rpc/xmlrpc'); | |
$xmlRpc->setCredentials('admin','123456'); |
This file contains hidden or 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
#!/bin/bash | |
# requires jq | |
# arg 1: iCloud web album URL | |
# arg 2: folder to download into (optional) | |
function curl_post_json { | |
curl -sH "Content-Type: application/json" -X POST -d "@-" "$@" | |
} |
This file contains hidden or 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
<?php | |
// get this data by logging into icloud.com on the calendars page and looking at the dev tools | |
// as per https://translate.google.com/translate?sl=de&tl=en&js=y&prev=_t&hl=de&ie=UTF-8&u=http%3A%2F%2Fnico-beuermann.de%2Fblogging%2Farchives%2F115-Zugriff-auf-iCloud-Kalender-mit-Thunderbird.html&edit-text=&act=url | |
$account = array( | |
'server' => '', // note, this will be p12 or something, not P0; see the server that iclod.com serves json from | |
'icloudid' => '', // the "dsid" | |
'appleid' => '', // your Apple ID; will be an email address | |
'pass' => '', // password for your Apple ID | |
'calid' => '' // the "pGuid" |
This file contains hidden or 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
// EXAMPLE QUESTIONS for the GIFT import filter | |
// by Paul Tsuchido Shew, January 2004. | |
//-----------------------------------------// | |
// Examples from the class description. | |
//-----------------------------------------// | |
Who's buried in Grant's tomb?{~Grant ~Jefferson =no one} | |
Grant is {~buried =entombed ~living} in Grant's tomb. |
This file contains hidden or 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 faker = require('faker') | |
var fs = require('fs') | |
var path = require('path') | |
for (var i = 0; i < 1000; i++) { | |
generateMD() | |
} | |
function generateMD () { | |
var fileName = faker.lorem.word() + '-' + faker.lorem.word() |
This file contains hidden or 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
<?php | |
$ids = array_column($array, "address"); | |
$ids = array_unique($ids); | |
$result_array = array_filter( | |
$array, | |
function ($key, $value) use ($ids) { | |
return in_array($value, array_keys($ids)); | |
}, | |
ARRAY_FILTER_USE_BOTH | |
); |
This file contains hidden or 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
<?php | |
function keyGenerate($leight) { | |
if (is_int($leight)) { | |
$array = array("1", "2", "3", "4", "5", "6", "7", "8", "9","0", | |
"A","B","D","E","F","G","H","I","J","K","L","M", | |
"N","O","P","Q","R","S","T","U","V","W","X","Y","Z"); | |
$count = count($array)-1; | |
$result = ""; | |
for ($i = 1; $i <= $leight; $i++) { | |
$random = mt_rand(0,$count); |
This file contains hidden or 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
<?php | |
use Carbon\Carbon; | |
use October\Rain\Database\Collection; | |
/** | |
* Class ScheduleFormatter | |
*/ | |
class ScheduleFormatter | |
{ |
This file contains hidden or 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
options = { :body => | |
{ :username => 'my', | |
:password => 'password' | |
} | |
} | |
results = HTTParty.post("http://api.topcoder.com/v2/auth", options) | |
## | |
## example for post with papertrail and basic auth | |
## |
This file contains hidden or 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
# Help for @lazylead | |
licence_file_path = "test_licence.txt" | |
file_name_teplate = /.+\.txt$/ | |
dir_path = 'one' | |
puts "Licence file: #{licence_file_path}\nFile name template: #{file_name_teplate.inspect}\nDirpath: #{dir_path}\nLicence text:\n" | |
p licence_text = File.read(licence_file_path) | |
stack = [dir_path] |
OlderNewer