This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <semaphore.h> | |
#include <pthread.h> | |
#define N 5 | |
#define THINKING 0 | |
#define HUNGRY 1 | |
#define EATING 2 |
This file contains 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
su | |
chmod 751 /etc/default/ufw /lib/ufw/ufw-init /etc/ufw/ufw.conf /usr/sbin/ufw /etc/ufw/applications.d/ufw-bittorent /etc/ufw/applications.d/ufw-directoryserver /etc/ufw/applications.d/ufw-loginserver /etc/ufw/applications.d/ufw-dnsserver /etc/ufw/applications.d/ufw-proxyserver /etc/ufw/applications.d/ufw-webserver /etc/ufw/applications.d/ufw-chat /etc/ufw/applications.d/ufw-printserver /etc/ufw/applications.d/ufw-fileserver /etc/ufw/applications.d/ufw-mailserver | |
ufw enable && ufw default deny incoming && ufw default allow outgoing |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
// Functions | |
// Clear Screen | |
void reset(int a) | |
{ | |
system("cls"); | |
if (a > 0) printf("\n\n"); |
This file contains 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
bajdzis.vscode-twig-pack | |
ban.spellright | |
bmewburn.vscode-intelephense-client | |
christian-kohler.path-intellisense | |
cjhowe7.laravel-blade | |
codingyu.laravel-goto-view | |
CoenraadS.bracket-pair-colorizer | |
dacoto.laravel-easy-blade-snippets | |
dbaeumer.jshint | |
dbaeumer.vscode-eslint |
This file contains 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
/* Remove circle and background and change padding, width and height from back button */ | |
:root:not([uidensity="compact"]) #back-button > .toolbarbutton-icon { | |
background-color: unset !important; | |
border: unset !important; | |
padding: var(--toolbarbutton-inner-padding) !important; | |
border-radius: var(--toolbarbutton-border-radius) !important; | |
width: calc(2 * var(--toolbarbutton-inner-padding) + 16px) !important; | |
height: calc(2 * var(--toolbarbutton-inner-padding) + 16px) !important; | |
} |
This file contains 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 | |
# cd to a directory where you want to install phoneGap | |
# and run following commands (or just download run this file with bash) | |
# https://github.com/phonegap/phonegap-app-desktop/commit/7a121fb96aef856cca36c6191778081e9d6317e5 | |
# https://github.com/phonegap/phonegap-app-desktop/commit/5ad750815ddf51e6cc8e557f46afb455e288b92e | |
sudo apt-get install libgconf-2-4 && | |
npm install -g grunt-cli && |
This file contains 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
interface IAjaxCall { | |
error: boolean; | |
status: number; | |
data: any; | |
} | |
/** | |
* async api call helper | |
* @param func function that'll return promise | |
*/ |
This file contains 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
export class Action { | |
constructor(type) { | |
this.type = type; | |
} | |
emit(detail) { | |
const event = new CustomEvent(this.type, { detail }); | |
window.dispatchEvent(event); | |
} |
This file contains 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
Object.defineProperty(Number.prototype, 'decimal', { | |
get: function decimal() { | |
Number.precision = 'precision' in Number ? Number.precision : 3; | |
const f = Math.pow(10, Number.precision); | |
return Math.round(this * f) / f; | |
}, | |
}); |
This file contains 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
const stickyIndex = 5; | |
const rows = document.querySelectorAll("table tr"); | |
const cellSlice = Array.prototype.slice.call(rows[0].children, 0, stickyIndex); | |
const widthList = Array.prototype.map.call(cellSlice, (cell) => cell.offsetWidth); | |
const leftOffsetList = widthList.map((_, index) => { | |
const output = -10; | |
for (let i = 0; i < index; i++) output = output + (widthList[i] - 1); | |
return output; | |
}); |
OlderNewer