Skip to content

Instantly share code, notes, and snippets.

View chellem's full-sized avatar
🎯
Focusing

Dickriven Chellemboyee chellem

🎯
Focusing
View GitHub Profile
@chellem
chellem / resetXcode.sh
Created November 29, 2021 07:22 — forked from maciekish/resetXcode.sh
Reset Xcode. Clean, clear module cache, Derived Data and Xcode Caches. You can thank me later.
#!/bin/bash
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf ~/Library/Developer/Xcode/DerivedData/*
rm -rf ~/Library/Caches/com.apple.dt.Xcode/*
open /Applications/Xcode.app
@chellem
chellem / date.php
Created November 9, 2015 07:47
Get number of days between 2 dates
<?php
if (count($argv)<=1) {
return usage();
}
$format = 'm/d/Y h:i A';
if (isset($argv[3])) {
$format = $argv[3];
}
@chellem
chellem / accounts.sh
Created December 4, 2014 16:36
List all accounts on the system with a login shell of Csh, sorted alphabetically by login name and display a screen at a time
cat /etc/passwd | grep /bin/csh | cut -d ‘:’ -f1 | sort | less
@chellem
chellem / datatables.datetime-flex.js
Last active August 29, 2015 14:10 — forked from mark47/datatables.datetime-flex.js
Flexible Euro Datetime
/**
* DataTables plug-in to handle euro.-style dates. Requires month day year.
* Time is optional and can be in 12 or 24 hour formats.
* Properly parses mm/m, dd/d and yyyy/yy.
*
* Based on original datetime-us plugin by Kevin Gravier.
*
* @name Flexible Euro Datetime
* @summary Sort dates and times in dd/mm/yyyy with optional time.
* @author Mark Stewart
@chellem
chellem / gist:1cd61ee8aa28cb02b139
Last active December 17, 2015 21:10
Eratosthenes
Eratosthenes(n){
e[1]:=0
(1) for i:=2 to n do
(2) e[i]:=1
p:=2
(3) while p*2<n do{
j:=p*2
(4) while(j<n)do{
(5) e[j]:=0
j:=j+p
@chellem
chellem / animate
Last active December 16, 2015 18:49
animate
animateMap: function(){
this.map.gmap3({
map:{
address:"POURRIERES, FRANCE",
options:{
zoom:4,
mapTypeId: google.maps.MapTypeId.SATELLITE,
mapTypeControl: true,
mapTypeControlOptions: {
style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
@chellem
chellem / addcron
Last active December 16, 2015 05:28
Add cronjob
private function addCronJob($jobs)
{
try {
$jobs=trim($jobs);
$filename=tempnam(sys_get_temp_dir(),'job');
if ($filename) {
file_put_contents($filename,$jobs.PHP_EOL);
}
exec("crontab {$filename}");
unlink($filename);