Skip to content

Instantly share code, notes, and snippets.

View zeusbaba's full-sized avatar
💻
artemis19

Yilmaz Guleryuz zeusbaba

💻
artemis19
View GitHub Profile
@zeusbaba
zeusbaba / FileIndexerUtil.java
Last active December 14, 2015 15:19
FileIndexerUtil for this & that
/***
* Copyleft - Almighty Matrix!
*
* @author: yg@wareninja.com
* @see https://github.com/WareNinja
* disclaimer: I code for fun, dunno what I'm coding about :)
*/
package utils;
package twitter_loop;
import com.mongodb.BasicDBObject;
import com.mongodb.DB;
import com.mongodb.DBCollection;
import com.mongodb.DBCursor;
import com.mongodb.Mongo;
import com.mongodb.MongoException;
import java.net.UnknownHostException;
import java.util.List;
/***
* Copyleft - incognito
*
* @author: incognito_at_wareninja
* @see https://github.com/WareNinja
* disclaimer: I code for fun, dunno what I'm coding about :)
*/
package utils;
@zeusbaba
zeusbaba / MyDateTimeInput.jsx
Last active February 26, 2018 08:18
admin-on-rest using material-ui-datetimepicker as custom input component
import React, { Component } from 'react';
import DateTimePicker from 'material-ui-datetimepicker';
import DatePickerDialog from 'material-ui/DatePicker/DatePickerDialog'
import TimePickerDialog from 'material-ui/TimePicker/TimePickerDialog';
import { Field } from 'redux-form';
const renderMyDateTimeInput = ({ input, meta: { touched, error } }) => (
// for more customisation, see https://github.com/dmtrKovalenko/material-ui-datetimepicker
@zeusbaba
zeusbaba / .eslintrc.js
Last active October 13, 2017 07:55
ESLINT via the easiest way
/*
// adapted from https://medium.com/@netczuk/your-last-eslint-config-9e35bace2f99
How to enable ESLINT via the easiest way?
1) prepare this file .eslintrc.js
2) remember to update .gitignore like this;
# Ignore all dotfiles...
@zeusbaba
zeusbaba / post-on-page-load.js
Last active November 21, 2017 17:59
Post-on-load
window.onload = function () {
postJsonData().then(function (theResult) {
console.log("theResult: " + theResult);
// do something else if necessary
});
}
function getJsonData() {
targetUrl = "https://api.etcetc.com/gooo";
return new Promise(function (resolve, reject) {
@zeusbaba
zeusbaba / using-chromium-for-local-dev.txt
Last active November 24, 2017 13:33
using-chromium-for-local-dev
>> installing & using CHROMIUM <<
- download CHROMIUM from https://www.chromium.org/Home
- how to run it with custom params, see here:
https://stackoverflow.com/a/42024918/492918
- and here is an example that disables CORS, local security validation, etc
chromium.exe --args --disable-web-security --user-data-dir --allow-insecure-localhost
@zeusbaba
zeusbaba / localStorage.js
Last active May 11, 2018 04:47
abstraction functions for using window.localStorage via store.js
// --- abstraction funcs for using LocalStorage via https://github.com/marcuswestin/store.js/ ---
var base_url = window.location.protocol + '//' + window.location.hostname;
var appConfig = {
duration: {
expiry: 3 * 60 *1000, // session-expiry period
warning: 1 * 60 * 1000, // duration before displaying popup
idle: 1 * 60 * 1000, // IDLE if user stays idle for this period
checker: 42*1000, // periodic duration used by timeoutChecker

Keybase proof

I hereby claim:

  • I am zeusbaba on github.
  • I am zeusbaba (https://keybase.io/zeusbaba) on keybase.
  • I have a public key whose fingerprint is 4043 C3F6 5816 E201 6F92 5803 7399 69A2 6866 E8CE

To claim this, I am signing this object:

@zeusbaba
zeusbaba / do-kubectl
Last active August 25, 2019 10:06
shortcut kubectl for DO-kubeconfig
vim ~/.bash_profile
# put this in your bash_profile, NB! use your own path+name for your DO-kubeconfig file
export KUBECONFIG=/FIXME/kubeconfigs/petcat-k8s-kubeconfig.yaml
export kubectl="kubectl --kubeconfig=$KUBECONFIG"
# then run this to make it active
source bash_profile
# now you can start using kubectl with DO kubeconfig with this shotcut cmd
$kubectl