Skip to content

Instantly share code, notes, and snippets.

View pwlin's full-sized avatar
🎧
Listening to Africa by Toto

pwlin pwlin

🎧
Listening to Africa by Toto
View GitHub Profile
@pwlin
pwlin / encoder.js
Created December 11, 2013 13:45 — forked from iron9light/encoder.js
var fsDoOverwrite = true // Overwrite file with base64 code
var fsAsASCII = false // Create base64 code file as ASCII file
var adTypeBinary = 1 // Binary file is encoded
function encode(from, to) {
var inputStream = WScript.CreateObject("ADODB.Stream");
inputStream.Type = adTypeBinary
inputStream.Open();
inputStream.LoadFromFile(from);
cd /root
rm -rf /root/src
mkdir -p /root/src
cd /root/src
rm -rf /root/src/node-*
rm /usr/local/bin/node
rm /usr/local/bin/npm
http://www.jamesnorthway.com/simple_file_printer_sharing_windows_2003.html
Enable the guest account with a blank password on Windows 2003
1. Click Start->Run and enter gpedit.msc
2. Locate Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options\Accounts: Guest account status and set it to Enabled
3. Now we give the guest account access to all the rights assigned to “Everyone” for file and folder permissions. Be warned, once we’re done here file and printer sharing on this server will have about the same level of security as file and printer shares on Windows 98 (none) – so don’t do this on anything accessible from outside a home or small office network.
git config user.email "[email protected]"
git config user.name "Your Name"
git config remote.origin.push HEAD
@pwlin
pwlin / foreach.js
Last active December 21, 2015 10:19
function forEach(obj, callback) {
for (prop in obj) {
if (obj.hasOwnProperty(prop)) {
callback(prop, obj[prop]);
};
};
};
var page = new WebPage(), testindex = 0, loadInProgress = false;
page.onConsoleMessage = function(msg) {
console.log(msg);
};
page.onLoadStarted = function() {
loadInProgress = true;
console.log("load started");
};
@pwlin
pwlin / AndroidManifest.xml
Last active December 16, 2015 17:49
example mainActivity with Actionbar
<uses-sdk android:minSdkVersion="14" android:targetSdkVersion="16"/>
<application android:icon="@drawable/ic_launcher" android:label="@string/app_name"
android:allowBackup="false"
android:hardwareAccelerated="true">
<activity android:name="class1" android:label="@string/app_name"
android:theme="@style/MyOwnTheme"
android:uiOptions="splitActionBarWhenNarrow"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale">
<intent-filter>
var exec = require('child_process').exec;
var ping = exec('ping 127.0.0.1');
/*var ping = exec('cmd /C ping 127.0.0.1');*/
ping.stdout.on('data', function (data) {
console.log('' + data);
});
sudo amdcccle
gksudo amdcccle
@pwlin
pwlin / gist:4147863
Created November 26, 2012 12:02
google translate dropdown
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en', layout: google.translate.TranslateElement.InlineLayout.SIMPLE}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>