Skip to content

Instantly share code, notes, and snippets.

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

@erayalakese
erayalakese / gist:7acbeb5e95cb02d0be26
Last active August 29, 2015 14:10
Bir CentOS sunucuda ihtiyaç duyduğum yedekleri alması için bir çırpıda yazdığım bash script
#!/bin/bash
# gerekli paketleri kontrol et ve kur
if ! rpm -qa | grep -qw tar; then
yum -y install tar
fi
if rpm -qa | grep -qw mysql; then
# mysql yüklü, yedekle
mysqldump -uroot -p --all-databases > mysqlbackup.sql
echo "MySQL YEDEKLEME TAMAM"
@erayalakese
erayalakese / r-debug.php
Last active August 29, 2015 14:18 — forked from Rarst/r-debug.php
<?php
/*
Plugin Name: R Debug
Description: Set of dump helpers for debug.
Author: Andrey "Rarst" Savchenko
Author URI: http://www.rarst.net/
License: MIT
*/
/**
@erayalakese
erayalakese / sanfrancisco-font.css
Created November 24, 2015 11:31
San Francisco Web Font
/**
* http://applemusic.tumblr.com/
* https://jsfiddle.net/xq56dmrh/
*/
/** Ultra Light */
@font-face {
font-family: "San Francisco";
font-weight: 100;
src: url("https://applesocial.s3.amazonaws.com/assets/styles/fonts/sanfrancisco/sanfranciscodisplay-ultralight-webfont.woff");
@erayalakese
erayalakese / .editorconfig
Created May 22, 2016 16:35
EditorConfig for npm packages
# EditorConfig is awesome: http://EditorConfig.org
# top-most EditorConfig file
root = true
[*.js]
charset = utf-8
max_line_length = 80
indent_style = space
indent_size = 2
@erayalakese
erayalakese / GitHousekeeping.md
Last active August 22, 2018 13:44
Git Repository House Keeping

Remove all merged (into master) remote branches First run with --dry-run and check if everything is OK

git branch -r --merged origin/master | 
grep origin | 
grep -v '>' | 
grep -v master | 
xargs -L1 | 
cut -d"/" -f2- | 
xargs git push origin --dry-run --delete
@erayalakese
erayalakese / README.md
Last active March 16, 2019 18:06 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.


@erayalakese
erayalakese / aws-secrets-manager-iam-policy.json
Created August 28, 2022 16:42
IAM Policy for AWS Secrets Manager
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "Stmt1661704784503",
"Action": [
"secretsmanager:GetSecretValue"
],
"Effect": "Allow",
"Resource": "arn:aws:secretsmanager:us-east-1:253256162899:secret:prod/my-app/mysql-yPJQfy"
@erayalakese
erayalakese / aws-secrets-manager-nodejs.js
Created August 28, 2022 16:49
aws-secrets-manager-nodejs-js
// Use this code snippet in your app.
// If you need more information about configurations or implementing the sample code, visit the AWS docs:
// https://aws.amazon.com/developers/getting-started/nodejs/
// Load the AWS SDK
var AWS = require('aws-sdk'),
region = "us-east-1",
secretName = "prod/my-app/mysql",
secret,
decodedBinarySecret;
@erayalakese
erayalakese / get-signed-url.js
Last active August 29, 2022 00:23
Get Signed URL of an AWS S3 Bucket Object
const { getSignedUrl } = require("@aws-sdk/s3-request-presigner");
const { S3Client, GetObjectCommand } = require("@aws-sdk/client-s3");
const client = new S3Client({ region: "eu-central-1" });
(async () => {
// Hardcoding our user for simplicity
const user = {id:1, subscribed: true}
// Preparing our GetObject command
const command = new GetObjectCommand({
Bucket: "member-only-videos",