Skip to content

Instantly share code, notes, and snippets.

💭
daemon

iKlsR

💭
daemon
Block or report user

Report or block iKlsR

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@iKlsR
iKlsR / redis.php
Created Jun 16, 2019 — forked from wuliupo/redis.php
php-redis-on-windows
View redis.php
<?php
$host = 'test.kvstore.aliyuncs.com';
$port = 6379;
$user = 'username';
$pwd = 'password1234';
$key = 'the_stored_key';
$redis = new Redis();
if ($redis->connect($host, $port) == false) {
die($redis->getLastError());
@iKlsR
iKlsR / main.cpp
Created May 2, 2019 — forked from alexesDev/main.cpp
Redux c++ implementation
View main.cpp
#include <mapbox/variant.hpp>
#include <redux.hpp>
struct Increment
{
};
struct Decrement
{
};
@iKlsR
iKlsR / vue.md
Created Mar 18, 2019 — forked from DawidMyslak/vue.md
Vue.js and Vuex - best practices for managing your state
View vue.md

Vue.js and Vuex - best practices for managing your state

Modyfing state object

Example

If you have to extend an existing object with additional property, always prefer Vue.set() over Object.assing() (or spread operator).

Example below explains implications for different implementations.

@iKlsR
iKlsR / java_class_launcher.bat
Last active Aug 29, 2015
drag and drop a .class file to execute it or set as the app to open
View java_class_launcher.bat
@echo off
REM http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/percent.mspx?mfr=true
start javaw %~n1
@iKlsR
iKlsR / vimcasts_scraper.py
Created Dec 14, 2014
download all the videos on vimcasts.org in mp4 format
View vimcasts_scraper.py
import json, urllib2
response = urllib2.urlopen("http://media.vimcasts.org/videos/index.json")
data = json.load(response)
number_of_videos = data.keys()
number_of_videos.sort(key=int)
urls = []
file_names = []
@iKlsR
iKlsR / webtext_automated.py
Last active Aug 29, 2015
Use your 30 free digicel texts from the comfort of your term
View webtext_automated.py
import mechanize, sys
class DigiWebTextDT(object):
def __init__(self):
self.br = mechanize.Browser()
# might want to change the locale for your region
self.br.open("https://webtext.digicelgroup.com/loginForm.do?country_code=JAM&language_code=en")
def get_credentials(self):
pass
@iKlsR
iKlsR / closeallwithoutsaving.jsx
Created Oct 19, 2014
close all open ps tabs without prompting to save
View closeallwithoutsaving.jsx
function closeCurrentWithoutSaving() {
if (app.activeDocument.length != 0)
app.activeDocument.close(SaveOptions.DONOTSAVECHANGES);
}
function closeAllWithoutSaving() {
while (documents.length != 0) {
for (var i = 0x00; i < documents.length; i++)
documents[i].close(SaveOptions.DONOTSAVECHANGES);
}
@iKlsR
iKlsR / Pascal.sublime-build
Created May 2, 2014
Pascal build system for st3
View Pascal.sublime-build
{
"cmd": ["fpc", "${file}"],
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.pas",
"variants": [
{
"name": "Run",
"cmd": ["$file_base_name"],
View newpsdfromclip.jsx
// units setup, doesn't matter eventually
var originalUnit = preferences.rulerUnits;
preferences.rulerUnits = Units.PIXELS;
// create a new document (size doesn't matter)
var docRef = app.documents.add(128, 128);
// get the current layer (background)
var topLayer = app.activeDocument.layers[0];
app.activeDocument.activeLayer = topLayer;
// rename/unlock it as it is locked by default
app.activeDocument.activeLayer.name = 'Unlocked';
You can’t perform that action at this time.